package com.fr.web.cluster;

import com.fr.base.XMLable;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;

public class ClusterService
  implements XMLable
{
  private String ip = null;
  private String port = null;
  private String serviceName = null;
  private String WebAppName = null;
  private boolean isSelf = false;

  public boolean isSelf()
  {
    return this.isSelf;
  }

  public void setSelf(boolean paramBoolean)
  {
    this.isSelf = paramBoolean;
  }

  public String getIp()
  {
    return this.ip;
  }

  public void setIp(String paramString)
  {
    this.ip = paramString;
  }

  public String getPort()
  {
    return this.port;
  }

  public void setPort(String paramString)
  {
    this.port = paramString;
  }

  public String getServiceName()
  {
    return this.serviceName;
  }

  public void setServiceName(String paramString)
  {
    this.serviceName = paramString;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    String str1;
    if (paramXMLableReader.isAttr())
    {
      if ((str1 = paramXMLableReader.getAttr("isSelf")) != null)
        setSelf(Boolean.valueOf(str1).booleanValue());
    }
    else if (paramXMLableReader.isChildNode())
    {
      String str2 = paramXMLableReader.getTagName();
      if ("ip".equals(str2))
        if ((str1 = paramXMLableReader.getElementValue()) != null)
          setIp(str1.trim());
      else if ("port".equals(str2))
        if ((str1 = paramXMLableReader.getElementValue()) != null)
          setPort(str1.trim());
      else if ("ServiceName".equals(str2))
        if ((str1 = paramXMLableReader.getElementValue()) != null)
          setServiceName(str1.trim());
      else if ("WebAppName".equals(str2))
        if ((str1 = paramXMLableReader.getElementValue()) != null)
          setWebAppName(str1.trim());
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("ClusterService").attr("isSelf", this.isSelf).startTAG("ServiceName").textNode(this.serviceName).end().startTAG("ip").textNode(this.ip).end().startTAG("port").textNode(this.port).end().startTAG("WebAppName").textNode(this.WebAppName).end().end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    ClusterService localClusterService = (ClusterService)super.clone();
    return localClusterService;
  }

  public String getWebAppName()
  {
    return this.WebAppName;
  }

  public void setWebAppName(String paramString)
  {
    this.WebAppName = paramString;
  }
}